﻿using Chloe;
using ChloeUtil;
using Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Police.BLL
{
    public class SysUserBLL
    {
        private IQuery<SysUser> q = MySqlUtil.context.Query<SysUser>();

        public SysUser Get(string username, string password)
        {
            SysUser user = q.Where(a => a.Username == username).Where(a => a.Password == password).FirstOrDefault();
            return user;
        }

        public List<SysUser> GetList(int pageIndex, int pageSize)
        {
            List<SysUser> models = q.Where(a => a.Id > 0).Skip(pageIndex * pageSize).Take(pageSize).ToList();
            return models;
        }
    }
}
